See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

buffer
The storage location for the received data.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
See Also Languages PowerTCP SSL Sockets for .NET

Read(Byte[],Int32,Int32) Method

Dart.PowerTCP.SslSockets Namespace > SegmentedStream Class > Read Method : Read(Byte[],Int32,Int32) Method

Read data from the stream into a byte array.

[Visual Basic]
Overloads Overrides Public Function Read( _    ByVal buffer() As Byte, _    ByVal offset As Integer, _    ByVal count As Integer _ ) As Integer
[C#]
public override int Read(    byte[] buffer,    int offset,    int count );
[C++]
public: int Read(    byte[]* buffer,    int offset,    int count ) override
[C++/CLI]
public: int Read(    bytearray<buffer>^ buffer,    int offset,    int count ) override

Parameters

buffer
The storage location for the received data.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.

Return Type

The total number of bytes read into the buffer.

Exceptions

ExceptionDescription
IOExceptionThrown when the stream is not Readable.
ArgumentNullExceptionThrown when the receiving buffer is null.
ArgumentOutOfRangeExceptionThrown when the offset is less than zero or when count is less than or equal to zero.
ArgumentExceptionThrown when the (offset + count) > buffer.Length.

Remarks

This method will block (for ReceiveTimeout) until at least 1 byte is available for reading, or the connection is closed by the server, in which case an empty string is returned. The Charset property is used to convert from bytes to unicode characters, which allows unicode characters to be passed over the network.

The value returned may be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached. Applications must check this value to know how many bytes were read into the buffer.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SegmentedStream Class  | SegmentedStream Members  | Overload List


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.